package com.icode;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.reflect.InvocationTargetException;

import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import net.miginfocom.swing.MigLayout;

import org.jvnet.substance.skin.SubstanceAutumnLookAndFeel;

import com.icode.utils.MenuApp;

public class LAFApplet extends JApplet implements ActionListener {
	private static final long serialVersionUID = 1L;
	private JButton btnLogin;
	private MenuApp menu;
	public void createForm() {
		JDialog.setDefaultLookAndFeelDecorated(true);
		this.setLayout(new MigLayout());
		
		this.btnLogin = new JButton("Login");
		this.menu = new MenuApp(this);
		
		this.getContentPane().add(this.btnLogin);
		this.setJMenuBar(this.menu);
		try {
			UIManager.setLookAndFeel(new SubstanceAutumnLookAndFeel());
			
		} catch (UnsupportedLookAndFeelException e) {
			e.printStackTrace();
		}
		SwingUtilities.updateComponentTreeUI(this);
		//Dang Ki Su Kien 
		this.btnLogin.addActionListener(this);
	}
	@Override
	public void init() {
		try {
			java.awt.EventQueue.invokeAndWait(new Runnable() {
				@Override
				public void run() {
					createForm();
				}
			});
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		super.init();
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		
	}
}
